package com.kly.user.task.enums;

import java.util.Objects;

/**
 * @author linqu
 */
public enum PushTypeEnum {
    /**
     * like back push
     */
    LIKE_BACK(1, "WHO_LIKE_ME"),
    /**
     * wlk push
     */
    WHO_LIKE_ME(2, "WHO_LIKE_ME"),

    ;


    private Integer code;

    private String name;



    PushTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public static PushTypeEnum getEnumByCode(Integer code) {

        if (Objects.isNull(code)) {
            return null;
        }

        PushTypeEnum TaskTypeEnum = null;

        for (PushTypeEnum p : PushTypeEnum.values()) {
            if (p.getCode().equals(code)) {
                TaskTypeEnum = p;
            }
        }
        return TaskTypeEnum;
    }

}
